Real-time software is everywhere—it runs our cars, elevators, smart phones, video games, hospital equipment, aircraft control systems; and even our refrigerators, home heating systems, washing machines, and others.
As we have become increasingly dependent on software for our everyday needs, efficient and orderly software execution has become increasingly important. In the early days of computing, computers with limited resources lead software developers to make every instruction count. Instructing the computer to do a series of inefficient tasks or to take a detour from the most direct route to a result wasn't an option. Now, as microprocessors, memory, and other computer components are more plentiful, inexpensive, and capable, some software developers pay less attention to code efficiency in the interest of shipping a product more quickly. Automatic code generation from compilers or other similar tools can save hundreds or thousands of man-hours, but such automatically generated code is often not streamlined or efficient. The result can be a poorly performing “bloated” piece of software.
Developing complex computer programs can be large projects that incorporate work from many different contributors (e.g., software engineers, artists, designers, etc). Like most joint efforts, large software projects sometimes perform poorly. Even simple programs may include such problems. Efficiently tracking down these and other problems can help to create better software.
One technique of tracking down problems and inefficiencies in software is to manually review the code. However, manually reviewing thousands or millions of lines of code can be incredibly complex and time consuming. Furthermore, the interaction of disparate components of an application is often difficult to understand. As a project becomes more and more complex (e.g., as more lines of code are added and more systems interact with each other), the overall complexity of manually reviewing the code of the application may increase exponentially.
One technique that may improve upon this manual method is to use tools such as software profilers. A profiler tool gives a user the ability to monitor the dynamic (e.g., run-time) behavior of a computer program. For example, information retrieved by running a profiler against a computer program may provide information on problematic sections of the computer program (e.g., sections that are operating slowly, etc).
Typically, profilers provide information related to the execution status of the software: for example, the number of times a particular function has been called, the amount of time a processor spends doing a particular function, or the amount of memory the program is consuming over time. A software developer may use this information to narrow down or identify a particular section of code (e.g., a function) that is the source of inefficiencies.
Information retrieved by a profiler is sometimes presented to a user in a textual format. For example, the number of calls to a particular function, or the amount of time spent executing a particular function, may be presented in a textual or tabular form. Text presentations are relatively simple and may be satisfactory for displaying one type of information (e.g., a number of function calls). However, a user wishing to correlate two different types of information may have difficultly doing so with a purely textual or tabular representation of the data.
A common saying is that “a picture is worth a thousand words.” Complex ideas and/or the correlation of large amounts of data can be made more readily understandable when presented in a visual format as opposed to a textual display. One technique for visualizing profile data is disclosed in U.S. Patent Publication No. 2010/0079463, the entire contents of which are hereby incorporated by reference. However, additional visualization techniques may be useful or desirable.
One interesting technique for visually presenting large amounts of information is a heat-map. Generally, heat-maps graphically represent variable information over a geographical area. As an example, when it is desired to relate or correlate various types of information to population density, presenting the information in a heat map can allow a person to quickly draw correlations or conclusions from the density and location information presented in the same composite view. For example, high population densities may be dark red while lower densities may be light red, with varying shades of red in-between the minimum and maximum state population densities. Thus, using the heat map, a person may draw inferences and conclusions regarding how two separate pieces of data may be correlated or related. The increased ability to correlate data may be facilitated by the ability to provide information along another dimension (e.g., relative location) without substantially detracting from the population density information (e.g., the color information).
It would be desirable to develop systems and/or methods that provide improved software analysis functionality for computer programs by improving the manual and/or automatic correlation of hardware performance counter or other data with functional information.
The technology herein thus relates to presentation, analysis, and/or correlation of sampled analysis data.
Certain computer programs, such as video games, are highly repetitive and predictable in terms of the code they execute. This occurs because visual output is typically displayed at predetermined intervals (e.g., 30 or 60 times per second). The visual output may then be tied to a repetitive cycle of simulation and rendering for each displayed frame. Accordingly, the simulation and rendering may be similar, but not identical, from frame-to-frame. This similarity in execution between frames may create a temporal coherence between the frames.
In certain instances, when profiling or measuring the performance of a computer program it may be desirable such that the measurements are unobtrusive with respect to the natural behavior of the program and/or hardware (e.g., with respect to computation, memory, bus traffic, etc). One technique for achieving this is to apply sampling to infrequently sample the current state of the program and/or hardware in order to construct a statistical picture of how the system is behaving. This sampled data may result in a large dataset that approximates program behavior over the duration of the measurement.
Because video games are frame-based, executing similar (but not always exact) code pathways for every frame or game tick, one may be able to assume that sample data from each frame will also be similar. For example, if simulation code is near the beginning of each frame, then the sample data may contain samples of simulation code near the beginning of each frame. By overlaying the sample data from each frame, trends in the data may be observed by a user. The overlaying may create a picture of what happens in a typical frame.
Profiling using statistical sampling results from one sample may not be very reliable as the sample was just a brief moment in time. However, sampling the CPU performance counters at the same rate may be different since performance counters accumulate data between samples. Correlating function samples and performance counters samples may be difficult and unreliable because each measurement is directed to different time periods (e.g., an infinitesimal moment in time versus the time between samples).
In certain instances, one solution for improving the understanding of the correlation between the different types is to overlay both types of sampling data aligned by the frame. This may allow unreliable individual function samples to overlay and show trends along with trends in the performance counter data.
Accordingly, the following non-limiting features and/or advantages may include: 1) Overlaying statistical CPU performance data, aligned by the frame; 2) Overlaying statistical function data, aligned by the frame; 3) Correlating the trends of each to glean as to which functions caused unusual CPU performance data;
In certain non-limiting illustrative embodiments, the software program is a structured and repetitive software program, such as, for example a video game. In certain non-limiting illustrative embodiments, the sampled data is presented in a color based visual display to facilitate correlation of different data types.
In certain example embodiments, a visual display of profiled data from a computer program is presented to a user. In certain example embodiments, the visual display may include sampled executed functions and hardware performance counter data. The visual display of these two pieces of data may facilitate correlation of the two pieces of data by a user.
In certain example embodiments, sampled functional and hardware performance counter data is based on the execution of a video game. In certain example embodiments, sampled data is overlaid and/or blended into a composite view based on each frame of execution of the video game.
In certain example embodiments, statistical CPU performance and/or statistical function data is aligned along a frame of execution of a computer program. In certain example embodiments, the alignment and blending of the functional and performance data on a frame by frame basis acts as a heat-map facilitating visual identification of correlations between the two pieces of data.
In certain example embodiments, a computer implemented method for gathering and presenting statistical data of a computer program is provided. A computer program is executed on a processing system over a period of time that is divided into a plurality of substantially equal data segments. A first type of profile data from the executing computer program is sampled. A second type of profile data from the executing computer program is sampled. In certain example embodiments, the first and second types of profile data are different types of data. A fractional value is assigned for each of the first and second types of profile data within each of the plurality of substantially equal data segments. A composite presentation of the first and second type of profile data is created by combining each of the plurality of substantially equal data segments in a single segment substantially equal to one of the plurality of substantially equal data segments. The composite presentation is presented.
In certain example embodiments, a non-transitory compute readable storage medium tangibly storing instruction that, when processed by at least one processor, execute the stored instructions. The stored instructions being configured to interact with an executing program. The stored instructions being configured to sample performance data from the executing computer program over a plurality segments. At least one sample of performance data sampled for each one of the plurality of segments. The stored instructions further configured to display a combined view of the sampled performance data from each of the plurality segments. When sampled performance data from one of the plurality of segments coincides with sampled performance data from another one of the plurality of segments the displayed combined view of the sampled performance data is changed in color and/or intensity. In certain example embodiments the sampled performance data includes sampled performance counter data and sample function data.
In certain example embodiments, a computer analysis system for presenting performance data to a user is provided. At least one microprocessor is configured to execute a target computer program. The target computer program is configured to execute similar code pathways for each one of a plurality of data segments. The at least one microprocessor is further configured to record performance counter information on the target computer program when the target computer program is executed on the at least one microprocessor. A processing system is also provided that is configured to sample performance that is associated with the executing target computer program at least once for each of the plurality of data segments, the performance information including recorded performance counter information and a section of source code that is associated with the recorded performance counter information. The sampled performance information is drawn into a composite display. A display value in the composite display is adjusted when sampled performance information from one of the plurality of data segments overlaps with the sampled recorded performance counter information from another one of the plurality of data segments. The composite display is presented to a user.
In certain example embodiments, a method for displaying statistical data of a computer program having a periodicity is provided. Profile sample data relating to the execution of the computer program is obtained. A heat map of the profile sample data with respect to the periodicity is graphically displayed. The profile sample data is overlaid to develop the graphical display; thereby varying intensity of the graphical display to indicate overlap of the profile sample data.